import * as comps from './tags/elements';

export const elements = comps;

export const initialValue = [
  {
    type: 'paragraph',
    children: [{text: 'This is editable '}, {text: 'rich', bold: true}, {text: ' text, '}, {text: 'much', italic: true}, {text: ' better than a '}, {text: '<textarea>', code: true}, {text: '!'}],
  },
  {
    type: 'paragraph',
    children: [
      {
        text: 'Since it\'s rich text, you can do things like turn a selection of text ',
      },
      {text: 'bold', bold: true},
      {
        text: ', or add a semantically rendered block quote in the middle of the page, like this:',
      },
    ],
  },
  {
    type: 'quote',
    children: [{text: 'A wise quote.'}],
  },
  {
    type: 'paragraph',
    children: [{text: 'Try it out for yourself!'}],
  },
];

export const formats = [
  {
    name: '撤回',
    format: 'undo',
    formatType: 'do',
    icon: 'UndoOutlined',
    disabled: true,
    component: () => {},
    handle: () => {},
  },
  {
    name: '重做',
    format: 'redo',
    formatType: 'do',
    icon: 'RedoOutlined',
    disabled: true,
  },
  {
    name: '标题H1',
    format: 'h1',
    formatType: 'block',
    icon: () => 'H1',
    component: elements['H1'],
  },
  {
    name: '标题H2',
    format: 'h2',
    formatType: 'block',
    icon: () => 'H2',
    component: elements['H2'],
  },
  {
    name: '有序列表',
    format: 'ol',
    formatType: 'block',
    icon: 'OrderedListOutlined',
    component: elements['Ol'],
  },
  {
    name: '无序列表',
    format: 'ul',
    formatType: 'block',
    icon: 'UnorderedListOutlined',
    component: elements['Ul'],
  },
  {
    name: '加粗',
    format: 'bold',
    formatType: 'mark',
    icon: 'BoldOutlined',
    component: elements['Bold'],
  },
  {
    name: '斜体',
    format: 'italic',
    formatType: 'mark',
    icon: 'ItalicOutlined',
    component: elements['Italic'],
  },
  {
    name: '下划线',
    format: 'underline',
    formatType: 'mark',
    icon: 'UnderlineOutlined',
    component: elements['Underline'],
  },
  {
    name: '删除线',
    format: 'strikethrough',
    formatType: 'mark',
    icon: 'StrikethroughOutlined',
    component: elements['Strikethrough'],
  },
  {
    name: '引用',
    format: 'quote',
    formatType: 'block',
    icon: 'InteractionOutlined',
    component: elements['Quote'],
  },
  {
    name: '代码块',
    format: 'code',
    formatType: 'mark',
    icon: 'CodeOutlined',
    component: elements['Code'],
  },
  {
    name: '字体大小',
    format: 'fontSize',
    formatType: 'do',
    icon: 'FontSizeOutlined',
    defaultValue: '14px',
    disabled: true,
    dropList: [
      {
        format: '12px',
        formatType: 'mark',
      },
      {
        format: '14px',
        formatType: 'mark',
      },
      {
        format: '16px',
        formatType: 'mark',
      },
      {
        format: '18px',
        formatType: 'mark',
      },
      {
        format: '20px',
        formatType: 'mark',
      },
      {
        format: '22px',
        formatType: 'mark',
      },
      {
        format: '24px',
        formatType: 'mark',
      },
    ],
  },
  {
    name: '字体颜色',
    format: 'color',
    formatType: 'mark',
    icon: 'FontColorsOutlined',
    disabled: true,
  },
  {
    name: '背景颜色',
    format: 'background',
    formatType: 'mark',
    icon: 'BgColorsOutlined',
    disabled: true,
  },
  {
    name: '分割线',
    format: 'dividing',
    formatType: 'block',
    icon: 'LineOutlined',
    disabled: true,
  },
  {
    name: '居中',
    format: 'alignCenter',
    formatType: 'block',
    icon: 'AlignCenterOutlined',
    disabled: true,
  },
  {
    name: '左对齐',
    format: 'alignLeft',
    formatType: 'block',
    icon: 'AlignLeftOutlined',
    disabled: true,
  },
  {
    name: '右对齐',
    format: 'alignRight',
    formatType: 'block',
    icon: 'AlignRightOutlined',
    disabled: true,
  },
  {
    name: '缩进',
    format: 'indent',
    formatType: 'block',
    icon: 'MenuUnfoldOutlined',
    disabled: true,
  },
  {
    name: '行间距',
    format: 'lineHeight',
    formatType: 'block',
    icon: 'ColumnHeightOutlined',
    disabled: true,
  },
  {
    name: '字体间距',
    format: 'spacing',
    formatType: 'block',
    icon: 'ColumnWidthOutlined',
    disabled: true,
  },
  {
    name: '清除格式',
    format: 'clear',
    formatType: 'mark',
    icon: 'DeleteOutlined',
    disabled: true,
  },
  {
    name: '格式刷',
    format: 'brush',
    formatType: 'mark',
    icon: 'ClearOutlined',
    disabled: true,
  },
  {
    name: '表格',
    format: 'table',
    formatType: 'block',
    icon: 'TableOutlined',
    disabled: true,
  },
  {
    name: '表情',
    format: 'emoji',
    formatType: 'mark',
    icon: 'SmileOutlined',
    disabled: true,
  },
  {
    name: '公式',
    format: 'latex',
    formatType: 'mark',
    icon: 'FunctionOutlined',
    disabled: true,
  },
  {
    name: '附件',
    format: 'file',
    formatType: 'mark',
    icon: 'FileUnknownOutlined',
    disabled: true,
  },
  {
    name: '流程图',
    format: 'flow',
    formatType: 'mark',
    icon: 'ClusterOutlined',
    disabled: true,
  },
  {
    name: '图片',
    format: 'image',
    formatType: 'mark',
    icon: 'PictureOutlined',
    disabled: true,
  },
  {
    name: '视频',
    format: 'video',
    formatType: 'mark',
    icon: 'VideoCameraOutlined',
    disabled: true,
  },
  {
    name: '音频',
    format: 'audio',
    formatType: 'mark',
    icon: 'AudioOutlined',
    disabled: true,
  },
  {
    name: '超链接',
    format: 'link',
    formatType: 'mark',
    icon: 'LinkOutlined',
    disabled: true,
  },
  {
    name: 'markdown',
    format: 'markdown',
    formatType: 'mark',
    icon: 'FileMarkdownOutlined',
    disabled: true,
  },
  {
    name: '文档导入',
    format: 'import',
    formatType: 'do',
    icon: 'ImportOutlined',
    disabled: true,
  },
];

export const editorI18n = {
  undo: '撤回',
  redo: '重做',
  h1: '标题H1',
  h2: '标题H2',
  ol: '有序列表',
  ul: '无序列表',
  bold: '加粗',
  italic: '斜体',
  underline: '下划线',
  strikethrough: '删除线',
  fontSize: '字体大小',
  color: '字体颜色',
  background: '背景颜色',
  quote: '引用',
  dividing: '分割线',
  alignCenter: '居中',
  alignLeft: '左对齐',
  alignRight: '右对齐',
  indent: '缩进',
  lineHeight: '行间距',
  spacing: '字体间距',
  clear: '清除格式',
  brush: '格式刷',
  code: '代码块',
  table: '表格',
  emoji: '表情',
  latex: '公式',
  file: '附件',
  flow: '流程图',
  image: '图片',
  video: '视频',
  audio: '音频',
  link: '超链接',
  markdown: 'markdown',
  import: '文档导入',
};

